New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle models without .objects manager in ModelSerializer. #6111
Handle models without .objects manager in ModelSerializer. #6111
Conversation
I think that would be better. |
Codecov Report
@@ Coverage Diff @@
## master #6111 +/- ##
==========================================
+ Coverage 96.17% 96.17% +<.01%
==========================================
Files 128 128
Lines 17599 17610 +11
Branches 1459 1459
==========================================
+ Hits 16926 16937 +11
Misses 465 465
Partials 208 208 |
Hi @carltongibson, thanks for prompt review ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Yes. This looks good to me. The use-case should be supported.
Thanks @K0Te! |
Should we use the manager's name instead of |
No, I don’t think so. (How would you do that? Default manager just picks the first manager defined on the class. Normally that’s “objects”, but people do all sorts of things...) |
Managers should have a |
|
* Handle models without .objects manager in ModelSerializer. * Improvements according to review comments.
This pull request is a proposed fix for #6110 .
Regression test-case is added.
Alternative solution is to use
Model._default_manager
, but current solution seems more simple.